Skip to contents

Provide the account of your station

userid <- Sys.getenv("WISP_IREA_USERID")
pwd <- Sys.getenv("WISP_IREA_PSW")

Get data from the WISP station server for a multiple dates

If you want to download the data for a single date, consider using the function wisp_get_reflectance_data() instead.

In this function if the save_csv parameter is set to TRUE, the function will save the reflectance data as a .csv file in the ‘output’ folder within the working directory.

reflect_data <- WISP.data::wisp_get_reflectance_multi_data(
  time_from = "2024-04-08T09:00",
  time_to = "2024-04-10T14:00",
  station = "WISPstation012",
  userid = userid,
  pwd = pwd,
  save_csv = FALSE
)

# ----
# 9 spectral signatures were removed during QC:
# 
# - 5 spectral signatures were removed thanks to QC1
# - 4 spectral signatures were removed thanks to QC2
# 
# The spectral signature of 2024-04-08 10:45:05 has been removed thanks to: QC2
# The spectral signature of 2024-04-08 11:00:05 has been removed thanks to: QC2
# The spectral signature of 2024-04-08 11:15:05 has been removed thanks to: QC2
# The spectral signature of 2024-04-08 11:30:05 has been removed thanks to: QC2
# The spectral signature of 2024-04-08 13:00:04 has been removed thanks to: QC1
# The spectral signature of 2024-04-08 13:15:05 has been removed thanks to: QC1
# The spectral signature of 2024-04-08 13:30:05 has been removed thanks to: QC1
# The spectral signature of 2024-04-08 13:45:04 has been removed thanks to: QC1
# The spectral signature of 2024-04-10 13:45:05 has been removed thanks to: QC1
# 
# QC1 remove spectral signatures with negative values below 845 nm
# QC2 remove spectral signatures with outliers in the NIR (840 nm > 700 nm)
# ----

Quality Check (QC) of the reflectance data

In this function if the save_csv parameter is set to TRUE, the function will save the quality checked reflectance data as a .csv file in the ‘output’ folder within the working directory.

reflect_data_qc <- WISP.data::wisp_qc_reflectance_data(
  data = reflect_data,
  maxPeak = 0.05,
  maxPeak_blue = 0.02,
  calc_scatt = TRUE,
  calc_SPM = TRUE,
  calc_TUR = TRUE,
  save_csv = FALSE
)

Sunglint Removal (SR) of the reflectance data

In this function if the save_csv parameter is set to TRUE, the function will save the reflectance data with the sunglint removed as a .csv file in the ‘output’ folder within the working directory.

reflect_data_sr <- WISP.data::wisp_sr_reflectance_data(
  qc_data = reflect_data_qc,
  calc_scatt = TRUE,
  calc_SPM = TRUE,
  calc_TUR = TRUE,
  save_csv = FALSE
)

Plot the reflectance data

WISP.data::wisp_plot_reflectance_data(
  data = reflect_data_sr,
  legend_TSM = TRUE,
  legend_Chla = TRUE,
  legend_Kd = FALSE,
  legend_cpc = FALSE
)